package cn.edu.ptu.jobfairs.web;

import cn.edu.ptu.jobfairs.basic.common.Result;
import cn.edu.ptu.jobfairs.basic.dto.request.IdDTO;
import cn.edu.ptu.jobfairs.basic.dto.InterviewDTO;
import cn.edu.ptu.jobfairs.basic.dto.request.InterviewQueryDTO;
import cn.edu.ptu.jobfairs.services.InterviewService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * Created by Lin Chenxiao on 2020-09-04
 **/
@RestController
@RequestMapping("/i")
public class InterviewController {
    @Resource
    private InterviewService interviewService;

    @PostMapping("/add")
    public Result add(InterviewDTO interviewDTO) {
        return interviewService.addInterview(interviewDTO);
    }

    @PostMapping("/edit")
    public Result edit(InterviewDTO interviewDTO) {
        return interviewService.editInterview(interviewDTO);
    }

    @PostMapping("/del")
    public Result del(IdDTO idDTO) {
        return interviewService.delInterview(idDTO);
    }

    @PostMapping("/list")
    public Result list(InterviewQueryDTO interviewQueryDTO) {
        return interviewService.listInterviews(interviewQueryDTO);
    }
}
